﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using System.Threading.Tasks;

namespace TestWorkPart2
{
    class TextInput
    {
        private string path = @"D:\Новая папка\Inteducation\yhladkova\TestWorkPart2\text.txt";

        public void WriteToFile()
        {
            string text = Console.ReadLine();
            File.AppendAllText(path, text);
        }

        public void WordCalculator()
        {
            string text = File.ReadAllText(@"D:\Новая папка\Inteducation\yhladkova\TestWorkPart2\text.txt");
            string[] textArray = text.Split(' ');
            Console.WriteLine("Количество слов - {0}", textArray.GetLength(0));
            File.Delete(@"D:\Новая папка\Inteducation\yhladkova\TestWorkPart2\text.txt");
        }

        
    }
}
